<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="com.google.inject.*, org.OpenGeoPortal.SiteSpecific.*,
org.OpenGeoPortal.SiteCustomizable.GuiceConfig"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Handler</title>
</head>
<body>

<%
// should this be a servlet, is there a way to wildcard the server.xml file?
		
String utln = request.getParameter("utln");
String password = request.getParameter("password");

// we need to use Guice to create the concrete type for UserAuthentication
Injector injector = Guice.createInjector(new GuiceConfig());  //context.getAttribute("theInjector");

UserAuthentication userAuthentication = injector.getInstance(UserAuthentication.class);
boolean success = userAuthentication.authenticate(utln, password);
if (success)
{
	session.setAttribute("UserID", utln);
	//redirect
}
else
{
	session.removeAttribute("UserID");
	//redirect
}
%>

</body>
</html>